package com.jdd.modules.parkCarAbnormalRecord.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum AbnormalTypeEnums {

    /**
     * 1：应急开闸
     * emergency opening
     */
    EMERGENCY_OPENING(1, "应急开闸"),
    /**
     * 遥控器开闸
     * Remote control opening
     */
    REMOTE_CONTROL_OPENING(2, "遥控器开闸"),
    /**
     * 无入场纪录
     * No entry record
     */
    NO_ENTRY_RECORD(3, "无入场纪录"),
    /**
     * 取消出场
     * cancel_out
     */
    CANCLE_OUT(4, "取消出场");

    @EnumValue
    private Integer code;

    private String describe;

    public static AbnormalTypeEnums instance(Integer code) {
        AbnormalTypeEnums[] values = values();
        for (AbnormalTypeEnums item : values) {
            if (item.code.equals(code)) {
                return item;
            }
        }
        return null;
    }

}
